package xue;

import java.util.HashMap;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.ThreadPoolExecutor;

public class MyThread {
    public static void main(String[] args) {
        TickTh t=new TickTh();
//        Thread t1=new Thread(t);
//        Thread t2=new Thread(t);
//        Thread t3=new Thread(t);
//        Thread t4=new Thread(t);
//        t1.start();
//        t2.start();
//        t3.start();
//        t4.start();
        ExecutorService pool= Executors.newFixedThreadPool(100);
        for (int i=0;i<100;i++){
            pool.execute(t);
        }
    }
}


class TickTh implements Runnable{
    int num=1000;
    Object object=new Object();
    @Override
    public void run() {
            if (num>0){
                while (true){
                    System.out.println(Thread.currentThread().getName()+":"+num);
                    num--;
                    if (num<=0){
                        break;
                    }
                }


        }
    }
}
